<ul class="media-list thread-list">
  <#list threads! as thread>
    <#assign group = (groups[thread.groupId?c])!{}/>
    <#if users??>
    <#assign user = users[thread.userId?c]!{}/>
    </#if>
    <li class="media">
      <a class="pull-left" href="${ctx}/user/${user.id}">
        <img src="${default_path('avatar',user.smallAvatar, '')}" class="media-object">
      </a>
      <div class="media-body">
        <#if thread.postNum??><span class="badge pull-right">${thread.postNum}</span></#if>
        <div class="media-heading">
          <#if thread.isStick?? && group??>
            <span class="label label-danger">置顶</span>
          </#if>
          <a class="title" href="${ctx}/group/${thread.groupId}/thread/${thread.id}">${fastLib.plainText(thread.title, 90)}</a>
          <#if thread.isElite??>
            <span class="label label-warning">精</span>
          </#if>

          <#if is_feature_enabled('group_reward') >
            <#if thread.type == 'reward' && thread.rewardCoin gt 0>
              <span class="label label-danger">奖</span>
            </#if>
          </#if>
        </div>
        
        <div class="metas">
          <#if group?? && group?size gt 0>
            <a class="link-muted" href="${ctx}/group/${thread.groupId}" title="${group.title}" >${group.title}</a>
            <span class="divider">•</span>
          </#if>
          <@web_macro.user_link user 'link-muted'/>
          <span class="divider">•</span>
          ${thread.createdTime?number_to_datetime?string('yyyy-MM-dd HH:mm:ss')}
          <#if thread.lastPostTime??>
            <span class="divider">•</span>
            最后回复 <@web_macro.user_link lastPostMembers[thread.lastPostMemberId?c]!{}, 'link-muted'/> ${thread.lastPostTime?number_to_datetime?string('yyyy-MM-dd HH:mm:ss')}
          </#if>
        </div> 
      </div>
    </li>
  <#else>
    <li class="empty">暂无话题！</li>
  </#list>
</ul>